package model;

import java.util.HashSet;
import java.util.Set;
import tools.Coord;


public class SeaArea extends Zone {

    public SeaArea (int num) {
        super(num);
    }

    public SeaArea(int num, Coord coordinates)
    {
        super(num, coordinates);
    }

    /**
     * Find all of the nearby provinces from a sea or group of closed seas
     * @return : Set of nearby provinces
     */
    public Set<Province> getNearbyProvincesThroughSeas()
    {
        Set<Province> listProvinces = new HashSet<Province>();
        for(Province p : this.getNearbyProvinces())
        {
            listProvinces.add(p);
        }
        for(SeaArea sa : this.getNearbySeaAreas())
        {
            listProvinces.addAll(sa.getNearbyProvinces());
        }
        return listProvinces;
    }
}

